Repository navigation
Conversation
|
cc @soft-suroleb, please take a look :) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1316 +/- ##
==========================================
+ Coverage 93.62% 93.93% +0.31%
==========================================
Files 27 27
Lines 4959 4966 +7
==========================================
+ Hits 4643 4665 +22
+ Misses 316 301 -15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
e924d32 to
bf8af98
Compare
bf8af98 to
72b41c7
Compare
Fixes using non-UTF-8 catalogs.
* Match compendium entries by context, and key the obsoleted translation replaced under --compendium-overwrite by context too. * Keep a compendium entry's fuzzy flag instead of clearing it. * Don't apply a compendium entry across pluralization. * Recognize untranslated plural messages * Skip untranslated compendium entries; they used to wipe out existing fuzzy translations.
72b41c7 to
1201386
Compare
1201386 to
4200364
Compare
There was a problem hiding this comment.
🟡 Changes recommended
An active moderate defect in Catalog.setitem can discard an existing singular translation when upgrading to a plural entry, so the change is not yet safe to approve.
1 open issue
What changed in this PR
This pull request follows up on #1161 with fixes for PO catalog concatenation, compendium merging, conflict serialization, encoding, and legacy catalog compatibility.
Changes:
- Improve handling of contextual, plural, untranslated, fuzzy, and conflicting messages.
- Refine compendium matching and translation application.
- Preserve catalog headers and support binary PO input.
- Add regression coverage and compatibility handling for catalogs without conflict metadata.
- Update coverage exclusions.
| File | Summary |
|---|---|
tests/messages/utils.py |
Adds helpers for creating PO files and executing catalog commands. |
tests/messages/test_pofile_write.py |
Tests writing catalogs without conflict metadata. |
tests/messages/frontend/test_merge.py |
Adds coverage for compendium matching, encoding, CLI behavior, and header handling. |
tests/messages/frontend/test_concat.py |
Adds coverage for contexts, plural conflicts, headers, translations, and fuzzy flags. |
babel/messages/pofile.py |
Reworks conflict serialization while preserving plural and contextual data. |
babel/messages/frontend.py |
Updates concatenation and compendium merge logic, including translation and header handling. |
babel/messages/catalog.py |
Clones conflict messages and tolerates catalogs without conflict-tracking state. |
.coveragerc |
Adjusts coverage exclusions for typing-only code and option-error paths. |
Review effort: Lite
| catalog[message.id] = message | ||
| stored = catalog.get(message.id, message.context) | ||
|
|
||
| if translated and not was_translated and stored.pluralizable == message.pluralizable: |
|
ping @soft-suroleb :) |

Follows up on #1161 with some bugfixes and clarifications.